package com.ee.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ee.bean.Equipment;
import com.ee.dao.EquipmentDao;
import com.ee.service.EquipmentService;
@Component("equipmentService")
public class EquipmentServiceImpl implements EquipmentService{
	private EquipmentDao equipmentDao;
	
	@Override
	public void add(Equipment equipment) {
		equipmentDao.saveEquipment(equipment);
	}

	@Override
	public void update(Equipment equipment) {
		equipmentDao.update(equipment);
	}

	@Override
	public void delete(Equipment equipment) {
		equipmentDao.deleteEquipment(equipment);
	}

	@Override
	public List<Equipment> getAllEquipments() {
		return equipmentDao.findAllEquipments();
	}

	@Override
	public Equipment getEquipmentById(int id) {
		return equipmentDao.findEquipmentById(id);
	}

	public EquipmentDao getEquipmentDao() {
		return equipmentDao;
	}

	@Resource
	public void setEquipmentDao(EquipmentDao equipmentDao) {
		this.equipmentDao = equipmentDao;
	}
	
}
